home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 May
/
EnigmA AMIGA RUN 07 (1996)(G.R. Edizioni)(IT)[!][issue 1996-05][EARSAN CD VI].iso
/
rubriche
/
host-cont
/
amountns.lha
/
AMountains
/
crinkle.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-01-14
|
2KB
|
59 lines
#ifndef CRINKLE
#define CRINKLE
typedef double Height;
typedef double Length;
#define START 0
#define STORE 1
#define NSTRIP 8
/* -------------------------------------------------------------------- */
/* strip of altitudes */
/* -------------------------------------------------------------------- */
typedef struct strip {
int level;
Height *d; // should have 2^level + 1 points
} Strip;
/* -------------------------------------------------------------------- */
/* parameters for the update */
/* -------------------------------------------------------------------- */
typedef struct parm {
Height mean; // mean altitude
int rg1; // optional regeneration steps
int rg2;
int rg3;
int cross; // use four point average on edges rather than 2
int force_front; // keep front edge low
int force_back; // keep back edge low
Height forceval; // value to force to
double mix; // fraction of old value to include in average
double midmix; // same but for cross updates
double fdim;
} Parm;
/* -------------------------------------------------------------------- */
/* The parameter struct for the recursive procedure */
/* -------------------------------------------------------------------- */
typedef struct fold {
int level; // levels of recursion below us
Length scale; // scale factor for perturbations
Length midscale; // as above but for diagonal offsets
struct parm *p; // update parameters
struct strip *s[NSTRIP]; // pointers to the pipeline strips
struct strip *save; // save position for STORE state
int stop; // level to stop recursion
int state; // internal stat of algorithm
struct fold *next; // next iteration down
} Fold;
Strip *next_strip( Fold * );
Fold *make_fold( Parm *, int, int, Length );
void free_fold( Fold * );
Length gaussian ( void );
#endif